#include <iostream>
#include <list>
using namespace std;
template <typename Container>
void display(const Container & con){
    for(auto & elem :con){
        cout << elem << " ";
    }
    cout << endl;
}
void test(){
   list<int> number = { 1,3,5,9,8,5,6,3,4 };
   display(number);
   cout <<endl<<"在list随机插入操作" <<endl;
   list<int>::iterator it = number.begin();
   //it +=2 list不支持+=
   ++it;
   ++it;
   cout <<"*it = "<< *it <<endl;
   number.insert(it ,300);
   display(number);
   cout << "*it = " << *it<<endl;
   number.insert(it,{234,2343,546,467,789});
   display(number);
   cout <<"*it = "<< *it << endl; 
}
int main()
{
    test();
    return 0;
}

